package com.boot.controller;

import com.boot.ao.login.AddLoginAO;
import com.boot.common.po.Result;
import com.boot.service.InfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/info")
@Api(value = "info", tags = "info", description = "login--接口规范")
public class InfoController {
    @Resource
    private InfoService loginService;


    @GetMapping("/getInfo")
    @ApiOperation(value = "拿信息",notes = "info",tags = "info")
    public Result getList(){
        return Result.success(loginService.getList());
    }

    @PostMapping("/add")
    @ApiOperation(value = "新增",notes = "新增",tags = "info")
    public Result addLogin(@RequestBody AddLoginAO addLoginAO){
        loginService.addLogin(addLoginAO);
        return Result.success();
    }

    @PostMapping("/delLogin")
    @ApiOperation(value = "删除",notes = "删除",tags = "info")
    public Result delLogin(@RequestParam("id") Long id){
        loginService.delLogin(id);
        return Result.success();
    }

}
